#ifndef __encoder_h
#define __encoder_h
#include "tim.h"


//typedef struct{
//	int64_t circle;
//	int64_t counter;
//	int count;
//	int count_ago;
//	u8 direction;
//	u8 direction_ago;
//	int count_change;
//	int pulse_speed_every_sec;
//	sys_tim encoder_speed_timer;
//}_encoder;


typedef struct{
	int circle;
	int counter;
	int16_t count;
	int16_t count_ago;
	u8 direction;
	u8 direction_ago;
	int16_t count_change;
	u16 pulse_speed_every_sec;
	sys_tim encoder_speed_timer;
}_encoder;

//typedef struct{
//	int circle;
//	int counter;
//	int16_t count;
//	u8 direction;
//	u16 pulse_speed_every_sec;
//	sys_tim encoder_speed_timer;
//}_encoder;



extern _encoder encoder;


void Encoder_Init(void);
void encoder_app(void);

#endif
